package cn.stylefeng.guns.modular.replenishment.mapper;

import cn.stylefeng.guns.modular.replenishment.entity.ReplenishmentOrder;
import cn.stylefeng.guns.modular.replenishment.model.params.ReplenishmentOrderParam;
import cn.stylefeng.guns.modular.replenishment.model.result.ReplenishmentOrderResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 补货单 Mapper 接口
 * </p>
 *
 * @author wp
 * @since 2025-05-26
 */
public interface ReplenishmentOrderMapper extends BaseMapper<ReplenishmentOrder> {

    /**
     * 获取列表
     *
     * @author wp
     * @Date 2025-05-26
     */
    List<ReplenishmentOrderResult> customList(@Param("paramCondition") ReplenishmentOrderParam paramCondition);

    /**
     * 获取map列表
     *
     * @author wp
     * @Date 2025-05-26
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") ReplenishmentOrderParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author wp
     * @Date 2025-05-26
     */
    Page<ReplenishmentOrderResult> customPageList(@Param("page") Page page, @Param("paramCondition") ReplenishmentOrderParam paramCondition, @Param("condition") String condition);

    /**
     * 获取分页map列表
     *
     * @author wp
     * @Date 2025-05-26
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") ReplenishmentOrderParam paramCondition);

    Integer getReplenishmentOrder(@Param("goodsNumber")  String goodsNumber,@Param("warehouseId") Integer warehouseId);

    Integer getAverageSale(@Param("goodsNumber") String goodsNumber);

    Integer getBoxQuantity(@Param("goodsNumber") String goodsNumber);

    int getPendingReplenishmentOrder(@Param("goodsNumber")String goodsNumber,@Param("deptId")Long deptId);

    void save(ReplenishmentOrder replenishmentOrderEntity);

    void saveReplenishmentOrder(ReplenishmentOrder replenishmentOrderEntity);

}
